﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MagneticSetter : MonoBehaviour {

    public Magnetic.Mode mode = Magnetic.Mode.North;

    private void OnTriggerEnter2D(Collider2D collision) {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Player")) {
            Magnetic.mode = mode;
            var arr = FindObjectsOfType<Magnetic>();
            foreach(var m in arr) {
                m.OnMagneticSetuped();
            }
        }
    }

}
